import { SHIPPING_STATUS_SELECT_LIST } from '@/pages/supplier/constants/common'

// 供应商管理 - 运费管理列表
const INITIAL_FIELDS_VALUE = {
  documentNo: '',
  supplierCode: '',
  supplierName: '',
  creator: '',
  creatorDepartment: '',
  createDate: ['', ''],
  shippingStatus: '',
  approvalStatus: '',
}
const FORM_ITEM_LIST = [
  {
    prop: 'supplierCode',
    label: '供应商代码',
    type: 'input',
  },
  {
    prop: 'supplierName',
    label: '供应商名称',
    type: 'input',
  },
  {
    prop: 'createUser',
    label: '创建人',
    type: 'input',
  },
  // startTime - endTime
  {
    prop: 'createDate',
    label: '创建日期',
    type: 'datePicker',
  },
  {
    prop: 'enabled',
    label: '是否启用',
    type: 'select',
    options: SHIPPING_STATUS_SELECT_LIST,
  },
]
const TABLE_COLUMNS = [
  {
    title: '供应商代码',
    key: 'supplierCode',
    width: 90
  },
  {
    title: '供应商名称',
    key: 'supplierName',
  },
  {
    title: '所属区域',
    key: 'areaName',
    width: 90
  },
  {
    title: '供货车队',
    key: 'fleetName',
    width: 90
  },
  {
    title: '运费类型',
    key: 'freightType',
  },
  {
    title: '计量单位',
    key: 'unitName',
    width: 80
  },
  {
    title: '单价（元）',
    key: 'price',
    width: 90
  },
  {
    title: '浮动比例',
    key: 'floatRatio',
    width: 90
  },
  {
    title: '运费描述',
    key: 'description',
  },
  {
    title: '是否启用',
    key: 'enabledName',
    width: 90
  },
  {
    title: '创建人',
    key: 'createUser',
  },
  {
    title: '创建时间',
    key: 'createTime',
  },
  {
    title: '备注',
    key: 'remark',
  },
]

const VIEW_FREIGHT_TABLE_COLUMNS = [
  { key: 'supplierCode', title: '供应商代码' },
  { key: 'supplierName', title: '供应商名称' },
  { key: 'supplyFleet', title: '供货车队' },
  { key: 'areaId', title: '所属区域' },
  { key: 'shippingType', title: '运费类型' },
  { key: 'unit', title: '计量单位' },
  { key: 'price', title: '单价（元）' },
  { key: 'floatingScale', title: '浮动比例' },
  { key: 'shippingDescription', title: '运费描述' },
  { key: 'enable', title: '是否启用' },
  { key: 'remark', title: '备注' },
]
export {
  INITIAL_FIELDS_VALUE,
  FORM_ITEM_LIST,
  TABLE_COLUMNS,
  VIEW_FREIGHT_TABLE_COLUMNS,
}
